<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
  
  <body>
    <input type="button" value="GET" onclick="sendGet()">
    <input type="button" value="POST" onclick="sendPost()">
  </body>
  
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.5.0/axios.js"></script>
  <script>
    function sendGet() {
      axios.get('http://localhost:9000/middleware_cors_get?query_name=query')
        .then(res => {
          console.log(res);
        });
    }
    
    function sendPost() {
      axios.post(
        'http://localhost:9000/middleware_cors_post',
        {
          body_name: 'body'
        }
      ).then(res => {
        console.log(res);
      });
    }
  </script>
</html>